<?php if ($row_user['userLevel'] == "3") { ?>
<p>The Jones International University Course Development Portal is a systematic way for course authors and instructional designers to prepare a course utilizing the tenents of the JIU course design model.</p>
<h2>The Proposal</h2>
<p>Think of a course's proposal as a blueprint. The proposal gives JIU staff the opportunity  to:</p>
<ol>
  <li>Assess whether the course will meet its goals. </li>
  <li>Consider its  feasibility to develop and deploy.&nbsp; </li>
</ol>
<p>The proposal comprises the basic structure of the course and will be used to guide  future development of its online materials, including learning outcomes,  assignments, assessments, and modules. The key is  to think &ldquo;big picture&rdquo; at this stage.&nbsp;  The framework of key deliverables should then guide your development of  course and module learning outcomes, module content, graded assignments and  reading assignments.</p>
<p>Listed below are the current courses you are working on.</p> 
<?php } else echo $row_user['firstName'].", all of the courses you are working on are listed below.</p>"; ?>
<?php if ($row_user['url_last'] != "") { ?>
<h2>Last Saved Place</h2>
<table class="dataTable">
  <tr>
    <th width="40%">Place</th>
    <th>Date/Time</th>
  </tr>
  <tr style="background-color: <?php echo $color2; ?>">
    <td class="data"><?php if ($row_user['url_last'] != CurrentPageURL()) { ?><a href="<?php echo str_replace("modal_window=true","modal_window=false",$row_user['url_last']); ?>"><?php } echo $row_user['url_title_last']; if ($row_user['url_last'] != CurrentPageURL()) { ?></a><?php } ?></td>
    <td class="data"><?php echo str_replace("-", " at ", $row_user['time_last']); ?></td>
  </tr>
</table>
<?php
}
if ($row_user['userLevel'] <= "2") { // dashboard for instructional designers and admins ?>
<h2>Courses</h2>
<?php if ($totalRows_courses > "0") { ?>

<table class="dataTable">
  <tr>
    <th>Course</th>
    <th width="15%">Content Expert</th>
    <th width="15%">Proposal Approved?</th>
    <th width="15%">Course Completed?</th>
    <th width="20%">Last Updated</th>
  </tr>
<?php do { 
$query_author = sprintf("SELECT * FROM users WHERE id='%s'", $row_courses['aid']); 
$author = mysql_query($query_author, $connection) or die(mysql_error());
$row_author = mysql_fetch_assoc($author);

$query_updater = sprintf("SELECT * FROM users WHERE id='%s'", $row_courses['user_id']); 
$updater = mysql_query($query_updater, $connection) or die(mysql_error());
$row_updater = mysql_fetch_assoc($updater);
?>
  <tr style="background-color: <?php echo $color; ?>">
    <td class="data">
	<?php echo $row_courses['jiu_course_id'].": ".$row_courses['name']; ?>
    <div class="stacked"><span class="icon"><img src="images/monitor.png" border="0" align="absmiddle" /></span><a href="index.php?section=view_proposal&cid=<?php echo $row_courses['id'];?>">View Course Proposal<?php if ($row_courses['proposal_complete'] != "Y") echo " Progress"; ?></a></div><?php if ($row_courses['proposal_complete'] == "Y") { ?><div class="stacked"><span class="icon"><img src="images/monitor.png" border="0" align="absmiddle" /></span><a href="index.php?section=view_course&cid=<?php echo $row_courses['id'];?>">View Course<?php if ($row_courses['course_complete'] != "Y") echo " Progress";?></a></div><?php } ?>
    </div>
    </td>
    <td class="data" nowrap="nowrap"><span class="icon"><img src="images/email_go.png" border="0" align="absmiddle" /></span><a href="mailto:<?php echo $row_author['email']; ?>?subject=<?php echo $row_courses['jiu_course_id'].": ".$row_courses['name']; ?>"  title="Send <?php echo $row_author['firstName']." ".$row_author['lastName']; ?> an email <?php echo "about ".$row_courses['jiu_course_id']; ?>."><?php echo $row_author['firstName']." ".$row_author['lastName']; ?></a></td>
    <td class="data" nowrap="nowrap"><?php if ($row_courses['proposal_complete'] == "Y") echo "<div><span class='icon'><img src='images/tick.png' align='absmiddle' border='0'></span>Yes &diams; <a href=\"javascript:confirmation('includes/process.inc.php?dbTable=courses&action=change&go=p_complete','id','".$row_courses['id']."','Are you sure you want to change the status of the ".$row_courses['jiu_course_id']." proposal to pending?');\">Change?</a></div>"; else echo "<div><span class='icon'><img src='images/exclamation.png' align='absmiddle' border='0'></span>No &diams; <a href=\"javascript:confirmation('includes/process.inc.php?dbTable=courses&action=change&go=p_complete','id','".$row_courses['id']."','Are you sure you want to change the status of the ".$row_courses['jiu_course_id']." proposal to approved?');\">Approve?</a></div>";
if (($row_courses['proposal_complete'] == "Y") && ($id == "default") && (($row_user['userLevel'] == "2") && ($row_courses['did'] == $row_user['id']) || ($row_user['userLevel'] <= "2"))) { ?>
<div class="stacked"><span class="icon"><img src="images/page_white_word.png" border="0" align="absmiddle" /></span><a href="index.php?section=courses&action=export&cid=<?php echo $row_courses['id']; ?>">Export Module Templates</a></div>
<div class="stacked"><span class="icon"><img src="images/printer.png" border="0" align="absmiddle" /></span><a href="#" onClick="window.open('export.php?action=print&amp;cid=<?php echo $row_courses['id']; ?>&amp;go=proposal','','height=1,width=1,toolbar=no,titlebar=no,status=no,menubar=yes,resizable=yes,scrollbars=yes,screenX=1,screenY=1'); return false;" title="Print the Proposal">Print Proposal</a>
</div>
<?php }?></td>
    <td class="data" nowrap="nowrap">
	<?php if ($row_courses['course_complete'] == "Y") echo "<div><span class='icon'><img src='images/tick.png' align='absmiddle' border='0'></span>Yes &diams; <a href=\"javascript:confirmation('includes/process.inc.php?dbTable=courses&action=change&go=c_complete','id','".$row_courses['id']."','Are you sure you want to change the status of ".$row_courses['jiu_course_id']." to incomplete?');\">Incomplete?</a></div>"; else echo "<div><span class='icon'><img src='images/exclamation.png' align='absmiddle' border='0'></span>No &diams; <a href=\"javascript:confirmation('includes/process.inc.php?dbTable=courses&action=change&go=c_complete','id','".$row_courses['id']."','Are you sure you want to change the status of ".$row_courses['jiu_course_id']." to complete?');\">Completed?</a></div>"; ?>
    </td>
    <td class="data"><?php if ($row_courses['updated'] != "") echo str_replace("-", " at ",$row_courses['updated'])." by ".$row_updater['firstName']." ".$row_updater['lastName']; else echo "Not Started"; ?></td>
  </tr>
<?php if ($color == $color1) { $color = $color2; } else { $color = $color1; } ?>
<?php } while ($row_courses = mysql_fetch_assoc($courses)); 
?>
</table>
<?php } else echo "<p>You have no course proposals in process. <a href='index.php?section=courses&amp;action=add'>Add one?</a></p>"; ?>
<h2>Functions</h2>
<table class="dataTable">
<tr>
	<th>To add a course and the associated content expert, do the following:</th>
</tr>
<tr>
	<td>
	<ol>
    	<li>Check if the Content Expert is in the database by clicking &quot;View Content Experts&quot; below. If not, click &quot;Add a Content Expert.&quot;</li>
    	<li>Check if the course is in the database by clicking &quot;View Courses&quot; below. If not, click "Add a Course.&quot;
      		<ol type="a" style="padding: .5em 0 0 0">
        	<li>Choose the appropriate content expert.</li>
        	<?php if ($row_user['userLevel'] == "1") echo "<li>Assign the Instructional Designer.</li>"; else echo "<li>You will automatically be assigned as the course's Instructional Designer.</li>"; ?>
      		</ol>
    	</li>
	</ol>
</td>
</tr>
</table>
<br />
<table class="dataTable">
<tr>
<th colspan="2">Choose:</th>
</tr>
<tr>
	<td width="25%">
	<ul>
    	<li><a href="index.php?section=ce&action=view">View Content Experts</a></li>
        <li><a href="index.php?section=courses&action=view">View Courses</a></li>
        <li><a href="index.php?section=id&action=view">View Instructional Designers</a></li>
	</ul>
    </td>	
    <td class="data">
    <ul>
        <li><a href="index.php?section=ce&action=add">Add a Content Expert</a></li>
        <li><a href="index.php?section=courses&action=add&dbTable=courses">Add a Course</a></li>
		<?php if ($row_user['userLevel'] == "1") { ?>
    	<li><a href="index.php?section=id&action=add">Add an Instructional Designer</a></li>
        <?php } ?>
	</ul>
    </td>
</tr>
</table>
<?php }
if (($row_user['userLevel'] == "3") && ($totalRows_courses > "0")) { // dashboard for content experts ?>
<h2>Courses</h2>
<table class="dataTable">
  <tr>
    <th>Course</th>
    <th width="15%">Proposal Approved?</th>
    <th width="15%">Proposal Completed?</th>
    <th width="15%">Last Updated</th>
    <th width="15%">Updated By</th>
  </tr>
<?php do { 
$query_updater = sprintf("SELECT * FROM users WHERE id='%s'", $row_courses['user_id']); 
$updater = mysql_query($query_updater, $connection) or die(mysql_error());
$row_updater = mysql_fetch_assoc($updater);
?>
  <tr style="background-color: <?php echo $color; ?>">
    <td class="data"><a href="index.php?section=<?php if ($row_courses['updated'] != "") echo "view_proposal"; else echo "cd&action=add"; ?>&cid=<?php echo $row_courses['id']; ?>"><?php echo $row_courses['jiu_course_id'].": ".$row_courses['name']; ?></a></td>
    <td class="data" nowrap="nowrap"><?php if ($row_courses['proposal_complete'] == "Y") echo "<span class='icon'><img src='images/tick.png' align='absmiddle' border='0'></span>Yes"; else echo "<span class='icon'><img src='images/exclamation.png' align='absmiddle' border='0'></span>No"; ?></td>
    <td class="data" nowrap="nowrap"><?php if ($row_courses['course_complete'] == "Y") echo "<span class='icon'><img src='images/tick.png' align='absmiddle' border='0'></span>Yes"; else echo "<span class='icon'><img src='images/exclamation.png' align='absmiddle' border='0'></span>No"; ?></td>
    <td class="data" nowrap="nowrap"><?php if ($row_courses['updated'] != "") echo $row_courses['updated']; else echo "Not started"; ?></td>
    <td class="data"><?php echo $row_updater['firstName']." ".$row_updater['lastName']; ?></td>
  </tr>
<?php if ($color == $color1) { $color = $color2; } else { $color = $color1; } ?>
<?php } while ($row_courses = mysql_fetch_assoc($courses)); 
?>
</table>
<?php } ?>